package com.lamer.console.common.aspect;

import lombok.extern.slf4j.Slf4j;
import org.aspectj.lang.JoinPoint;
import org.aspectj.lang.annotation.Aspect;
import org.aspectj.lang.annotation.Before;
import org.aspectj.lang.annotation.Pointcut;
import org.springframework.context.annotation.Configuration;

@Aspect
@Configuration
@Slf4j
public class LogAspect {

    //注入service用于把日志保存到数据库，实际项目入库采用队列做异步

    @Pointcut("execution(public * com.lamer.console.blog.service.impl.AuthorServiceImpl.*(..))")
    public void webLog(){

    }

    @Before("webLog()")
    public void before(JoinPoint joinPoint){
        log.debug("Before invoke method" + joinPoint);
    }

}
